/*
 * function getQueryString(name) {
        name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
                results = regex.exec(location.search);
        return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
    }
 */

function getQueryString(paraName) {
	var url = document.location.toString()
	var arrObj = url.split('?')
	if (arrObj.length > 1) {
		var arrPara = arrObj[1].split('&')
		var arr
		for (var i = 0; i < arrPara.length; i++) {
			arr = arrPara[i].split('=')
			if (arr != null && arr[0] == paraName) {
				return arr[1]
			}
		}
		return ''
	} else {
		return ''
	}
}

export { getQueryString }
